﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BW.MLTT.Repository.Migrations
{
    public partial class log1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CultivationEnterprises",
                columns: table => new
                {
                    CultivationEnterpriseId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    CultivationEnterpriseName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationEnterprisePeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationEnterpriseNum = table.Column<int>(type: "int", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CultivationEnterprises", x => x.CultivationEnterpriseId);
                });

            migrationBuilder.CreateTable(
                name: "Cultivations",
                columns: table => new
                {
                    CultivationId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    CultivationType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationDay = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationBrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationPeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CultivationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Cultivations", x => x.CultivationId);
                });

            migrationBuilder.CreateTable(
                name: "GoodImmunes",
                columns: table => new
                {
                    GoodImmuneId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ImmuneId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GoodImmunes", x => x.GoodImmuneId);
                });

            migrationBuilder.CreateTable(
                name: "Goods",
                columns: table => new
                {
                    GoodId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    GoodName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodBatch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodShelf = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodNoSc = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodFirm = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodPerfect = table.Column<int>(type: "int", nullable: false),
                    GoodImage = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodCreatePeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodCreateTime = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodUpdatePeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Goods", x => x.GoodId);
                });

            migrationBuilder.CreateTable(
                name: "Imagess",
                columns: table => new
                {
                    ImageId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ImageAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ImageFkId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Imagess", x => x.ImageId);
                });

            migrationBuilder.CreateTable(
                name: "Immunes",
                columns: table => new
                {
                    ImmuneId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ImmuneDay = table.Column<int>(type: "int", nullable: false),
                    ImmuneType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ImmuneWay = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Immunes", x => x.ImmuneId);
                });

            migrationBuilder.CreateTable(
                name: "ProcessEnterprises",
                columns: table => new
                {
                    ProcessEnterpriseId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ProcessEnterpriseName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProcessEnterpriseNoSc = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProcessEnterprises", x => x.ProcessEnterpriseId);
                });

            migrationBuilder.CreateTable(
                name: "Processs",
                columns: table => new
                {
                    ProcessId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ProcessClass = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProcessPeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processs", x => x.ProcessId);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterEnterprises",
                columns: table => new
                {
                    SlaughterEnterpriseId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    SlaughterEnterpriseName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterEnterpriseAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterEnterpriseTime = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterEnterpriseComment = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterEnterprises", x => x.SlaughterEnterpriseId);
                });

            migrationBuilder.CreateTable(
                name: "Slaughters",
                columns: table => new
                {
                    SlaughterId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    SlaughterLot = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterWeight = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterstartTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterEndTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughters", x => x.SlaughterId);
                });

            migrationBuilder.CreateTable(
                name: "Suppliers",
                columns: table => new
                {
                    SupplierId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    SupplierLot = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodId = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Suppliers", x => x.SupplierId);
                });

            migrationBuilder.CreateTable(
                name: "Users",
                columns: table => new
                {
                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UserNickname = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Users", x => x.UserId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CultivationEnterprises");

            migrationBuilder.DropTable(
                name: "Cultivations");

            migrationBuilder.DropTable(
                name: "GoodImmunes");

            migrationBuilder.DropTable(
                name: "Goods");

            migrationBuilder.DropTable(
                name: "Imagess");

            migrationBuilder.DropTable(
                name: "Immunes");

            migrationBuilder.DropTable(
                name: "ProcessEnterprises");

            migrationBuilder.DropTable(
                name: "Processs");

            migrationBuilder.DropTable(
                name: "SlaughterEnterprises");

            migrationBuilder.DropTable(
                name: "Slaughters");

            migrationBuilder.DropTable(
                name: "Suppliers");

            migrationBuilder.DropTable(
                name: "Users");
        }
    }
}
